package at.guigu.controller;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;
import java.util.Date;

// 自定义类型转换器
@Controller
@RequestMapping("/user3")
public class UserControllerThree {

    @ResponseBody
    @RequestMapping("/quickk1")
    public void save1(@RequestParam("date") Date date,
                      @DateTimeFormat(pattern = "yyyy-MM-dd") @RequestParam("date1") Date date1,
                      @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @RequestParam("date2") Date date2) throws IOException {
        System.out.println(date);
        System.out.println(date1);
        System.out.println(date2);
    }
}
